<template>
  <div>
    <div class="adBox" :class="{displayOr:yesornoDisplay}">
      <div class="adBoxDelete">
        <div @click="adDelete">x</div>
      </div>
      <div class="adWrap">
        <div class="adBoxLeft">
          <img src="" alt="">
          <div class="adBoxLeftText">
            <div>前往APP查看更多特惠商品</div>
            <div>网易自营 品质生活</div>
          </div>
        </div>
        <div class="adBoxRight" @click="adDelete">
          打开APP
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent,ref,onMounted} from "vue"
export default defineComponent({
  name: 'Ad',
})
</script>

<script lang="ts" setup>
const yesornoDisplay = ref(false)
const emit = defineEmits(['dsp'])
emit('dsp',adDelete)
onMounted(()=>{
  emit('dsp',adDelete)
})
function adDelete() {
  yesornoDisplay.value=true
}
</script>
  
<style scoped>
.adBox {
  height: 52px;
  position: relative;
  background-color: #333333;
  color: white;
}

.adBox .adBoxDelete {
  position: absolute;
  top: 0;
  left: 0;
  border: 10px solid #5C5C5C;
  border-right: 10px solid transparent;
  border-bottom: 10px solid transparent;
  color: black;
  z-index: 77;
}

.adBox .adBoxDelete div {
  position: absolute;
  top: -12px;
  left: -8px;
  color: #ACACAC;
}

.adBox .adWrap {
  position: absolute;
  height: 52px;
  width: 375px;
  box-sizing: border-box;
  padding: 0 20px;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.adBox .adWrap .adBoxLeft {
  display: flex;
  font-size: 12px;
}

.adBox .adWrap .adBoxLeft img {
  width: 36px;
  height: 36px;
  margin-right: 8px;
  border-radius: 8px;
  background-color: aqua;
}

.adBox .adWrap .adBoxRight {
  width: 72px;
  height: 27px;
  line-height: 27px;
  text-align: center;
  border-radius: 5px;
  background-color: #FF1531;
}
.displayOr{
  display: none;
}
</style>